package com.wzy.controller;
import com.wzy.pojo.*;

import com.wzy.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;



@Controller
public class HelloController {
@Autowired
        private UserService userService;
    @RequestMapping(value="login")
    public String Hello(User user,Model model){
        if(userService.findUser(user)) {
            return "FirstPage";
        }else{
            model.addAttribute("login", "账号或密码错误");
            return "index";
        }
    }
    @RequestMapping(value="firstPage")
    public String FirstPage(){
        return "FirstPage";
    }


}
